package com.answer.petadoption.service.impl;

import com.answer.petadoption.mapper.AnimalMapper;
import com.answer.petadoption.model.entity.Animal;
import com.answer.petadoption.service.AnimalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnimalServiceImpl implements AnimalService {
    @Autowired
    private AnimalMapper animalMapper;

    @Override
    public Animal getAnimalById(Long id) {
        return animalMapper.getAnimalById(id);
    }

    @Override
    public List<Animal> getAnimalsByName(String name) {
        return animalMapper.getAnimalsByName(name);
    }

    @Override
    public List<Animal> getAnimalsBySpecies(String species) {
        return animalMapper.getAnimalsBySpecies(species);
    }

    @Override
    public void insertAnimal(Animal animal) {
        animalMapper.insertAnimal(animal);
    }

    @Override
    public void updateAnimal(Animal animal) {
        animalMapper.updateAnimal(animal);
    }

    @Override
    public void deleteAnimal(Long id) {
        animalMapper.deleteAnimal(id);
    }
}